package tree;

public class TreeTest {
    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();
        BinaryTree.TreeNode root = tree.createTree();

        System.out.println("=====");

        tree.preOrder(root);
        System.out.println();
        tree.inOrder(root);
        System.out.println();
        tree.postOrder(root);
        System.out.println();
        System.out.println(tree.size(root));
        System.out.println(tree.size2(root));
        System.out.println(tree.getLeafNodeCount(root));
        System.out.println(tree.getLeafNodeCount2(root));
        System.out.println("树的第四层节点个数为： "+tree.getKLevelNodeCount(root, 4));
        System.out.println("树的高度："+tree.getHeight(root));
        BinaryTree.TreeNode node = tree.find(root, 'F');
        System.out.println("要找的节点值为："+ node.val);
        System.out.println(true || false);

        System.out.println("=====");
        tree.levelOrder(root);
        boolean completeTree = tree.isCompleteTree(root);
        System.out.println(completeTree);
        System.out.println("=====");
        tree.preOrderNor(root);
        System.out.println();
        tree.preOrder(root);
        System.out.println();
        tree.inOrderNor(root);
        System.out.println();
        System.out.println("=====");
        tree.postOrderNor(root);


    }
}
